//
// Created by cheng on 2021/03/10.
//

#include "Heap.h"

using namespace std;

int main() {
    int len = 5;
    int arr[5] = {4, 1, 3, 2, 16};
    auto heap1 = new Heap<int>();
    heap1->InsertInMaxHeap(4);
    heap1->InsertInMaxHeap(1);
    heap1->InsertInMaxHeap(3);
    heap1->InsertInMaxHeap(2);
    heap1->InsertInMaxHeap(16);
    heap1->PrintData("初始大根堆");
    auto max = heap1->ExtractFromMaxHeap();
    cout << "堆顶：" << max << endl;
    heap1->PrintData("去掉堆顶");
    heap1->InsertInMaxHeap(16);
    heap1->PrintData("添加堆顶元素");
}